﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Behavior
{
    public partial class About : Page
    {
        public About()
        {
            InitializeComponent();
            tempTest.DataContext = new { c = GetBusColor() };

        }

        // 当用户导航到此页面时执行。
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ////样式模板 
            //System.Text.StringBuilder _BusSymbolOverlapTemplate = new System.Text.StringBuilder();
            //_BusSymbolOverlapTemplate.AppendLine("                <DataTemplate   xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> ");
            //_BusSymbolOverlapTemplate.AppendLine("                        <Grid Grid.Column='1' Width='24' Height='24'>");//车辆图标大小
            //_BusSymbolOverlapTemplate.AppendLine("                            <Ellipse Width='17' Height='17'> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                <Ellipse.Fill> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                    <RadialGradientBrush GradientOrigin='.2,.2'> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                        <GradientStop  Offset='0.2'  Color='White' /> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                        <GradientStop  Color='{Binding  EllipseColor}'  Offset='0.8'/> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                    </RadialGradientBrush> ");
            //_BusSymbolOverlapTemplate.AppendLine("                                </Ellipse.Fill> ");
            //_BusSymbolOverlapTemplate.AppendLine("                            </Ellipse> ");
            //_BusSymbolOverlapTemplate.AppendLine("                        </Grid> ");
            //_BusSymbolOverlapTemplate.AppendLine("                </DataTemplate> ");

            //tempTest.ContentTemplate = (DataTemplate)System.Windows.Markup.XamlReader.Load(_BusSymbolOverlapTemplate.ToString());
            

        }


        /// <summary>
        /// 根据车辆状态获取车辆颜色值
        /// </summary>
        /// <returns></returns>
        private string GetBusColor()
        {
     

            string color = BusSymbolColorEntity.ExceptionBusBall.ToString();//一般颜色车辆

            return color;
        }
    }

    /// <summary>
    /// 表示当前线路上的车辆 颜色区分
    /// </summary>
    public class BusSymbolColorEntity
    {

        #region 车辆颜色
        /// <summary>
        /// 上行车辆的图标颜色
        /// </summary>
        public static Color UpBusBall //FF384BD0
        {
            get
            {
                return Color.FromArgb(0XFF, 0X38, 0X4B, 0XD0);
            }
        }

        /// <summary>
        /// 下行车辆的图标颜色
        /// </summary>
        public static Color DownBusBall //FF38B130
        {
            get
            {
                return Color.FromArgb(0XFF, 0X38, 0XB1, 0X30);
            }
        }

        /// <summary>
        /// 异常车辆的图标颜色
        /// </summary>
        public static Color ExceptionBusBall //FFED4D4D
        {
            get
            {
                return Color.FromArgb(0XFF, 0XED, 0X4D, 0X4D);
            }
        }

        /// <summary>
        /// 一般车辆的图标颜色
        /// </summary>
        public static Color CommonBusBall //FF8B52BE
        {
            get
            {
                return Color.FromArgb(0XFF, 0X8B, 0X52, 0XBE);
            }
        }

        /// <summary>
        /// 断线车辆的图标颜色
        /// </summary>
        public static Color UnConnectBusBall //FF878080
        {
            get
            {
                return Color.FromArgb(0XFF, 0X87, 0X80, 0X80);
            }
        }


        /// <summary>
        /// 偏离线路车辆的图标颜色
        /// </summary>
        public static Color AwayFromLineBusBall //FFCCBD07
        {
            get
            {
                return Color.FromArgb(0XFF, 0XCC, 0XBD, 0X07);
            }
        }

        /// <summary>
        /// 未知方向车辆的图标颜色
        /// </summary>
        public static Color UnknowDirBusBall //FF9C56C0
        {
            get
            {
                return Color.FromArgb(0XFF, 0X46, 0XC8, 0XBC);
            }
        }

        /// <summary>
        /// 驾驶员请求车辆的图标颜色
        /// </summary>
        public static Color DriverReqBusBall //FF673FC8
        {
            get
            {
                return Color.FromArgb(0XFF, 0X67, 0X3F, 0XC8);
            }
        }

        /// <summary>
        /// 选中的车辆
        /// </summary>
        public static Color SelectedBus
        {
            get
            {
                return Color.FromArgb(255, 0, 0, 210);
            }
        }

        #endregion

        #region 示意图

        /// <summary>
        /// 示意图上行车辆统计
        /// </summary>
        public static Color UpBusCount
        {
            get
            {
                return Color.FromArgb(255, 140, 255, 140);
            }
        }

        /// <summary>
        /// 示意图下行车辆统计
        /// </summary>
        public static Color DownBusCount
        {
            get
            {
                return Color.FromArgb(255, 255, 255, 136);
            }
        }

        #endregion

        #region 线路颜色

        /// <summary>
        /// 上行线路颜色
        /// </summary>
        public static Color UpRouteLineColor //FF6E82E0
        {
            get
            {
                return Color.FromArgb(0XFF, 0X6E, 0X82, 0XE0);
            }
        }

        /// <summary>
        /// 下行线路颜色
        /// </summary>
        public static Color DownRouteLineColor //FF54BC74
        {
            get
            {
                return Color.FromArgb(0XFF, 0X54, 0XBC, 0X74);
            }
        }

        /// <summary>
        /// 未激活线路颜色
        /// </summary>
        public static Color UnActiveRouteLineColor //FF1ECC12
        {
            get
            {
                return Color.FromArgb(0XFF, 0X1E, 0XCC, 0X12);
            }
        }

        /// <summary>
        /// 轨迹颜色
        /// </summary>
        public static Color TrackLineColor //FFC60000
        {
            get
            {
                return Color.FromArgb(0XFF, 0XC6, 0X00, 0X00);
            }
        }

        #endregion

        #region 停车场颜色

        /// <summary>
        /// 停车场内部填充色
        /// </summary>
        public static Color ParkPolygonFill //CC4BD275
        {
            get
            {
                return Color.FromArgb(0XCC, 0X4B, 0XD2, 0X75);
            }
        }

        /// <summary>
        /// 停车场边框色
        /// </summary>
        public static Color ParkPolygonBorder //FFDA8328
        {
            get
            {
                return Color.FromArgb(0XFF, 0XDA, 0X83, 0X28);
            }
        }

        #endregion
    }

}